package com.xiaobaibai.bo;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class SubscribeMessageBo {

    private SubscribeMessageBo(){

    }

    public SubscribeMessageBo(String access_token, String touser, String template_id, Map<String,String> data) {
        this.access_token = access_token;
        this.touser = touser;
        this.template_id = template_id;
        this.data=new HashMap<>(data.size());
        for(String key:data.keySet()){
            JSONObject jsonObject=new JSONObject();
            jsonObject.put("value",data.get(key));
            this.data.put(key,jsonObject);
        }

    }

    private String access_token;

    private String touser;

    private String template_id;

    private Map<String, JSONObject> data;

    //todo 版本
    private String miniprogram_state="trial";

    //todo 跳转页面
//    private String page;

}
